package wicresoft.controller.expertInfo;


import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import services.dictionary.*;
import wicresoft.controller.common.BaseController;
import wt.entity.dictionary.AffiliateCompany;

import java.util.List;

/**
 * 功能:
 * 作者: 洪世成
 * 日期: 2017/9/9
 * 版权所有: admin
 */
@Controller
@RequestMapping("httpPage")
public class DictionaryPublicOpenController extends BaseController {
    @Autowired
    CertificateTypeServices certificateTypeServices;
    @Autowired
    ItemTypeServices itemTypeServices;

    @Autowired
    FundSetServices fundSetServices;

    @Autowired
    LeaveReasonServices leaveReasonServices;

    @Autowired
    LockReasonServices lockReasonServices;

    @Autowired
    MajorTypeServices majorTypeServices;
    @Autowired
    AffiliateCompanyServices affiliateCompanyServices;



    @ResponseBody
    @RequestMapping("affiliateCompanyOnlyLive")
    public JSONArray affiliateCompanyOnlyLive() throws Exception {
        List<AffiliateCompany> affiliateCompanyList = affiliateCompanyServices.selectLiveAffiliateCompany();
        JSONArray jsonArray = new JSONArray();
        for (AffiliateCompany affiliateCompany : affiliateCompanyList) {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("id", affiliateCompany.getName());
            jsonObject.put("text", affiliateCompany.getName());
            jsonArray.add(jsonObject);
        }
        return jsonArray;

    }







}
